package com.tianma;

import com.tianma.component.CanalClient;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan("com.tianma.dao")
public class Application implements ApplicationRunner {

    private final CanalClient canalClient;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    public Application(CanalClient canalClient) {
        this.canalClient = canalClient;
    }

    @Override
    public void run(ApplicationArguments args) {
        canalClient.start();
    }

}
